#ifndef _share_mem_h
#define	_share_mem_h

#include <stdio.h>
#include <signal.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <sys/sem.h>
#include <string.h>
#include "transport_layer.h"
#include "errlib.h"
#include <errno.h>
#include <stdlib.h>

#define SHMKEY	(key_t)0x10 /* shared mem key */
#define SEMKEY	(key_t)0x22 /* shared sem key */

/* buffer size for reads and writes */
#define SIZ 5*BUFSIZ

#define IFLAGS	(IPC_CREAT | IPC_EXCL)

/* will hold data and read count */
struct databuf
{
	int d_nread;
	char d_buf[SIZ];
};

#define ERR	((struct databuf *)-1)

typedef union _semun
{
	int val;
	struct semid_ds * buf;
	ushort * array;
}semun;

typedef struct _shmemT
{
	int shmid;
	int semid;
	struct databuf * buf;
}shmemT;

#endif

